# -*- coding:utf-8 -*-
import enum

from enum import IntEnum

@enum.unique
class ETableStringValueType(IntEnum):
    """
    tableString代表的table中的value类型
    """
    AllTrue = 1,
    DataInIndex = 2,
    Table = 3

    @classmethod
    def value_str(cls, key):
        key_map = {
            cls.AllTrue.value : "值始终为true",
            cls.DataInIndex.value : "以数据组中指定索引位置的数据为value",
            cls.Table.value : "value是含有复杂数据的table"
        }
        return key_map.get(key, "")

    @classmethod
    def is_contains(cls, key):
        for name, dataType in cls.__members__.items():
            if key == dataType.value:
                return True
        return False

if __name__ == "__main__":
    print(ETableStringValueType.AllTrue.value)
    print("---------------------------")
    print(ETableStringValueType.value_str(ETableStringValueType.AllTrue.value))
    print("---------------------------")
    print(ETableStringValueType.is_contains(ETableStringValueType.AllTrue.value))